package com.api.shopapi.mapper;

import com.api.shopapi.entity.NursingSchedulingDaytime;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

@Repository
@Mapper
public interface NursingSchedulingDaytimeMapper {

    @Insert("insert into  nursing_scheduling_daytime " +
            "(NursingSchedulingDaytimeCode,NursingSchedulingCode) " +
            "values (#{nursingSchedulingDaytime.NursingSchedulingDaytimeCode} ,#{nursingSchedulingDaytime.NursingSchedulingCode} )")
    int insert(@Param("nursingSchedulingDaytime") NursingSchedulingDaytime nursingSchedulingDaytime);

    @Update("update nursing_scheduling_daytime set NursingSchedulingCode=#{nursingSchedulingDaytime.NursingSchedulingCode} where NursingSchedulingDaytimeCode=#{nursingSchedulingDaytime.NursingSchedulingDaytimeCode}   ")
    int updateByNursingSchedulingDaytimeCode(@Param("nursingSchedulingDaytime") NursingSchedulingDaytime nursingSchedulingDaytime);

    @Delete("delete from nursing_scheduling_daytime where nursingSchedulingDaytimeCode=#{nursingSchedulingDaytimeCode} ")
    int deleteByNursingSchedulingDaytimeCode(@Param("nursingSchedulingDaytimeCode")String nursingSchedulingDaytimeCode);

    @Select("select * from nursing_scheduling_daytime where NursingSchedulingDaytimeCode=#{nursingSchedulingDaytimeCode} limit 1")
    NursingSchedulingDaytime getByNursingSchedulingDayTimeCode(@Param("nursingSchedulingDaytimeCode")String nursingSchedulingDaytimeCode);

    @Select("select * from nursing_scheduling_daytime where NursingSchedulingCode=#{nursingSchedulingCode} limit 1")
    NursingSchedulingDaytime getByNursingSchedulingCode(@Param("nursingSchedulingCode")String nursingSchedulingCode);

    @Delete("delete from nursing_scheduling_daytime where NursingSchedulingCode=#{nursingSchedulingCode} ")
    int deleteByNursingSchedulingCode(@Param("nursingSchedulingCode") String nursingSchedulingCode);
}
